1. Field of the Invention
The present invention relates to image conversion between the RGB (Red, Green Blue) color representation and another color representation. Some embodiments of the invention are suitable for use with lossless and lossy data compression/decompression systems for image data.
2. Related Art
In many applications that carry out color image processing, it is necessary to convert data between two color spaces. Many modern devices that deal with digital color images, such as computer monitors and TV equipment, use RGB (Red, Green, Blue) color representation. However, if we need to use compression for storing or transmitting large amounts of color image data, the RGB representation is not optimal. Usually data is converted from the RGB color coordinate system to a TV standard (YCbCr, YUV, YIQ) prior to compression. All of these TV standard systems provide luminance and chrominance separation. The change of chrominance is less perceptible to the human eye than the change of luminance, and some lossy compression techniques take advantage of this fact.
For example, the JPEG2000 standard uses the YCbCr color coordinate system for lossy compression. JPEG2000 is a shorthand for the Joint Photographic Experts Group JPEG 2000 standard for coding of still pictures, described in “JPEG 2000 Final Committee Draft version 1.0,” 16 Mar. 2000, incorporated herein by reference. The YCbCr system is defined in terms of R, G, and B by the following matrix equation:
      [                            Y                                                  C            b                                                            C            r                                ]    =            [                                    0.299                                0.587                                0.114                                                              -              0.1687                                                          -              0.3313                                            0.5                                                0.5                                              -              0.4187                                                          -              0.0813                                          ]        ⁢                  [                            R                                      G                                      B                      ]  Y is the luminance component, and Cb and Cr are chrominance components. The matrix equation implies that the luminance Y is given by the following equation:Y=0.299R+0.587G+0.114B  (1)According to studies of the human visual perception, this equation is a good representation of the luminance as perceived by the human eye. Below, this representation is referred to as “the model of human visual system” and used as a standard against which other luminance representations are measured.
In digital image processing, the color at each pixel is usually represented by integer numbers. Thus, the data R, G, B, and the luminance and chrominance components are usually formatted as integers. However, the coefficients of the YCbCr transformation are not integers and actual computer implementations of the RGB to YCbCr conversion are not reversible because of numeric precision problems and an accumulation of errors.
When color conversion is used in conjunction with lossless compression, it is typically expected that the R, G, and B data can be recovered precisely (through decompression and reverse conversion), so the color conversion should be reversible. This is why the JPEG2000 standard uses a different color representation for lossless compression, namely:
                              [                                                    Y                                                                    U                                                                    V                                              ]                =                              [                                                            0.25                                                  0.5                                                  0.25                                                                              1                                                                      -                    1                                                                    0                                                                              0                                                                      -                    1                                                                    1                                                      ]                    ⁢                                          [                                                    R                                                                    G                                                                    B                                              ]                                    (        2.1        )            The luminance component in this representation is:
                    Y        =                                            1              4                        ⁢            R                    +                                    1              2                        ⁢            G                    +                                    1              4                        ⁢            B                                              (        2.2        )            The chrominance components are:U=R−G  (2.3)V=B−G  (2.4)
It has been shown in U.S. Pat. No. 5,731,988 issued Mar. 24, 1998 to Zandi et al. that even though the Y coefficients in equation (2.2) are not integers, the transformation (2.1) is reversible.
Therefore, to perform both lossy and lossless compression according to the JPEG2000 standard, the compression system has to contain color converters of both types, i.e. both a YCbCr converter and a converter for the transformation (2.1).
U.S. Pat. No. 6,044,172, issued Mar. 28, 2000 to Allen, discloses another reversible color conversion with a luminance that is closer to the model (1) than the luminance (2.2), namely:
                    Y        =                  ⌊                                                    3                ⁢                R                            +                              6                ⁢                G                            +              B                        10                    ⌋                                    (        3.1        )                                U        =                  R          -          G                                    (        3.2        )                                V        =                  B          -          G                                    (        3.3        )            
Here └x┘ symbolizes a floor function and indicates the largest integer not exceeding “x”.
The transformation (3.1) is however more computationally expensive than (2.1).